package com.zshan.clinic.database.model;

import java.io.Serializable;
import java.util.Date;

/**
 * 消息最后阅读
 */
public class ClinicNoticeLastRead implements Serializable {
    /** 主键ID */
    private Long readId;

    /** 员工ID */
    private Long empId;

    /** 最新消息 */
    private String lastMsg;

    /** 最新消息时间 */
    private Date lastMsgTime;

    /** 最后阅读时间 */
    private Date lastReadTime;

    /** 消息未读数 */
    private Integer unreadNum;

    /** 诊所ID */
    private Long clinicId;

    /** 创建时间 */
    private Date createTime;

    /** 更新时间 */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Long getReadId() {
        return readId;
    }

    public void setReadId(Long readId) {
        this.readId = readId;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public String getLastMsg() {
        return lastMsg;
    }

    public void setLastMsg(String lastMsg) {
        this.lastMsg = lastMsg == null ? null : lastMsg.trim();
    }

    public Date getLastMsgTime() {
        return lastMsgTime;
    }

    public void setLastMsgTime(Date lastMsgTime) {
        this.lastMsgTime = lastMsgTime;
    }

    public Date getLastReadTime() {
        return lastReadTime;
    }

    public void setLastReadTime(Date lastReadTime) {
        this.lastReadTime = lastReadTime;
    }

    public Integer getUnreadNum() {
        return unreadNum;
    }

    public void setUnreadNum(Integer unreadNum) {
        this.unreadNum = unreadNum;
    }

    public Long getClinicId() {
        return clinicId;
    }

    public void setClinicId(Long clinicId) {
        this.clinicId = clinicId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ClinicNoticeLastRead other = (ClinicNoticeLastRead) that;
        return (this.getReadId() == null ? other.getReadId() == null : this.getReadId().equals(other.getReadId()))
            && (this.getEmpId() == null ? other.getEmpId() == null : this.getEmpId().equals(other.getEmpId()))
            && (this.getLastMsg() == null ? other.getLastMsg() == null : this.getLastMsg().equals(other.getLastMsg()))
            && (this.getLastMsgTime() == null ? other.getLastMsgTime() == null : this.getLastMsgTime().equals(other.getLastMsgTime()))
            && (this.getLastReadTime() == null ? other.getLastReadTime() == null : this.getLastReadTime().equals(other.getLastReadTime()))
            && (this.getUnreadNum() == null ? other.getUnreadNum() == null : this.getUnreadNum().equals(other.getUnreadNum()))
            && (this.getClinicId() == null ? other.getClinicId() == null : this.getClinicId().equals(other.getClinicId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getReadId() == null) ? 0 : getReadId().hashCode());
        result = prime * result + ((getEmpId() == null) ? 0 : getEmpId().hashCode());
        result = prime * result + ((getLastMsg() == null) ? 0 : getLastMsg().hashCode());
        result = prime * result + ((getLastMsgTime() == null) ? 0 : getLastMsgTime().hashCode());
        result = prime * result + ((getLastReadTime() == null) ? 0 : getLastReadTime().hashCode());
        result = prime * result + ((getUnreadNum() == null) ? 0 : getUnreadNum().hashCode());
        result = prime * result + ((getClinicId() == null) ? 0 : getClinicId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", readId=").append(readId);
        sb.append(", empId=").append(empId);
        sb.append(", lastMsg=").append(lastMsg);
        sb.append(", lastMsgTime=").append(lastMsgTime);
        sb.append(", lastReadTime=").append(lastReadTime);
        sb.append(", unreadNum=").append(unreadNum);
        sb.append(", clinicId=").append(clinicId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}